<?php

namespace App\Http\Controllers\Admin;
use DB;
use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;

class peizhiController extends Controller
{
 /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function getPeizhi()
    {
        $users=DB::table('peizhi')->where('id',1)->first();
       return view('Admin.peizhi.peizhi',['users'=>$users]);

    }


     public function postUpdate(Request $request){

            $data=$request->except('_token'); 
        
       //执行数据修改
        $res=DB::table('peizhi')->where('id',1)->update($data);
      

       if($res){

             //重定向到user/index
            return redirect('admin/peizhi/peizhi')->with('success','修改成功');
        }else{
            //回到上个页面
            return back()->with('error','修改失败');

        }

        
    }
}
